Imports System.Collections.Generic

Imports System.Web

#Region "using"
Imports System.Data
Imports QUANLY.DAO
Imports QUANLY.DTO
#End Region
Public Class TOUR_KHACHSANBUS
	Private objDAO As TOUR_KHACHSANDAO
	Public Sub New(strPath As [String])
		objDAO = New TOUR_KHACHSANDAO(strPath)
	End Sub

	Public Function SelectAll() As DataSet
		Dim ds As DataSet
		Try
			ds = objDAO.SelectAll()
			Return ds
		Catch e As System.Exception
			Throw New Exception(e.Message, e.InnerException)
		End Try
	End Function

	Public Function SelectByID(id As Integer) As DataSet
		Dim ds As DataSet
		Try
			ds = objDAO.SelectByID(id)
			Return ds
		Catch e As System.Exception
			Throw New Exception(e.Message, e.InnerException)
		End Try
	End Function

	Public Function Insert(obj As TOUR_KHACHSANDTO) As Boolean
		Try
			Return objDAO.Insert(obj)
		Catch
			Return False
		End Try
	End Function

	Public Function Delete(id As Integer) As Boolean
		Try
			Return objDAO.Delete(id)
		Catch
			Return False
		End Try
	End Function

    Public Function DeleteByIDTour(ByVal idtour As Integer) As Boolean
        Try
            Return objDAO.DeleteByIDTour(idtour)
        Catch
            Return False
        End Try
    End Function

	Public Function Update(obj As TOUR_KHACHSANDTO) As Boolean
		Try
			Return objDAO.Update(obj)
		Catch
			Return False
		End Try
	End Function

	Public Function SelectByIDKhachSan(idkhachsan As Integer) As DataSet
		Dim ds As DataSet
		Try
			ds = objDAO.SelectByIDKhachSan(idkhachsan)
			Return ds
		Catch e As System.Exception
			Throw New Exception(e.Message, e.InnerException)
		End Try
	End Function

    Public Function SelectByIDTour(ByVal idtour As Integer) As DataSet
        Dim ds As DataSet
        Try
            ds = objDAO.SelectByIDTour(idtour)
            Return ds
        Catch e As System.Exception
            Throw New Exception(e.Message, e.InnerException)
        End Try
    End Function

End Class
